<template>
  <el-container class="wrapperPage">
    <el-aside width="200px">
      <div class="logo">黑马头条</div>
      <el-menu
        default-active="2"
        class="el-menu-vertical-demo"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b"
      >
        <el-menu-item index="2" @click="$router.push('/postList').catch(err=>{})">
          <i class="el-icon-menu"></i>
          <span slot="title">文章列表</span>
        </el-menu-item>
        <el-menu-item index="3" @click="$router.push('/editPost').catch(err=>{})">
          <i class="el-icon-edit"></i>
          <span slot="title">文章编辑</span>
        </el-menu-item>
      </el-menu>
    </el-aside>
    <el-container>
      <el-header>您的管理,让页面逢毕生辉</el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {};
</script>

<style lang="less" scoped>
.wrapperPage {
  height: 100vh;
}

.el-header,
.el-footer {
  background-color: #333333;
  color: #fff;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #000000;
  color: #fff;
  text-align: center;
  line-height: 60px;
  .logo {
    font-size: 26px;
    font-weight: bold;
  }
}

.el-main {
  background-color: #f2f2f2;
  color: #333;
  text-align: center;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>